package com.yuan.config;

import com.yuan.bean.Color;
import com.yuan.bean.ColorFactorBean;
import com.yuan.bean.Red;
import com.yuan.condition.MyImportBeanDefinitionRegistrar;
import com.yuan.condition.MyImportSelector;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.swing.text.rtf.RTFEditorKit;

/**
 * @Author: Jinsheng·yuan
 * @CreateDate: 2020/1/14 21:59
 * @Description: 使用@Import 注册组件
 */
@Configuration
@Import({Color.class, Red.class,MyImportSelector.class, MyImportBeanDefinitionRegistrar.class})
public class ColorMainConfig {

    /**
     * 注入ColorFactorBean对象
     * @return
     */
    @Bean
    public ColorFactorBean colorFactorBean(){
        return new ColorFactorBean();
    }
}
